home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / SRL.BAT < prev    next >
DOS Batch File  |  1991-07-11  |  4KB  |  94 lines

  1. :SRL.BAT search only using FGREP.COM                           July 11, 1991
  2. :
  3. :1) SYNTAX:                          SRL.BAT %1 %2 %3
  4. :                                  ┌──────────┘  │  └───────────┐
  5. :             (Mode)              %1            %2             %3
  6. :                            Search Text     File Name/List  Option
  7. :         ----------------   -------------   --------------  -------
  8. :      a) Query                   [ ]           [ ]            [ ]
  9. :      b) Partial Query      Search Text        [ ]            [ ]
  10. :      c) Partial Query      Search Text        [ ]          Option
  11. :      d) Command line       Search Text     File Name/List    [ ]
  12. :      e) All command line   Search Text     File Name/List  Option
  13. :
  14. :         where:    %1  - Search Text
  15. :                   %2  - File Name or @FileList
  16. :                   %3  - FGREP options, no minus
  17. :                   [ ] - entered at query prompt
  18. :2) Requires FGREP.COM and INPUT.COM
  19. :3) Uses File List %FileName% if no File Name is specified during input.
  20. :   Specify File Name list as [@FileList] to use an alternate File_List,
  21. :   or specify File Name, wild cards OK.
  22. :4) FGREP options can be input at option prompt or %3, Default option is "fl"
  23. :5) Set environment variable OPT=off to bypass FGREP Option query prompt.
  24. :   Set  OPT=    to *not* bypass FGREP Option query prompt.
  25. :
  26. :
  27. :
  28. :*******************************************************************************
  29. :*                                                                             *
  30. :* Environment Variable        Action                                          *
  31. :* --------------------------- ----------------------------------------------- *
  32. :* set opt=                    does not bypass option query prompt             *
  33. :* set opt=off                 bypasses option query prompt                    *
  34. :* set filelist=               uses sm.lst for testing this batch file         *
  35. :* set filelist=srch-fg.lst    searches with standard file list srch-fg.lst    *
  36. :* set filelist=c:\srch-fg.lst searches with standard file list c:\srch-fg.lst *
  37. :* set srmac=                  macro files are located in current directory    *
  38. :* set srmac=c:\               macro files are located in c:\ directory        *
  39. :*                                                                             *
  40. :*******************************************************************************
  41. :
  42. @echo off
  43. cls
  44. set S~~=%1
  45. set file=%2
  46. set option=%3
  47. if     "%filelist%" == "" set filelist=sm.lst
  48. if not "%1" == ""    if not "%2" == "" goto 2b
  49. if not "%1" == ""    goto 1a
  50. if     "%1" == ""    echo Search Text: [{Blank} terminates batch file]
  51. INPUT.COM Search Text=/b
  52. if errorlevel=1 goto 6a
  53. set S~~=%ans%
  54. goto 2a
  55. :1a
  56. echo Search Text=%S~~%
  57. :2a
  58. set ans=
  59. if "%2" == "" echo File Name(s): [{Blank}=%FileList%]  [File Name(s)]  [@FileList]
  60. INPUT.COM File Name(s)=/b
  61. if errorlevel=1 goto 2b
  62. set file=%ans%
  63. :2b
  64. set ans=
  65. if not "%opt%" == "" goto 2c
  66. if not    "%3" == "" goto 2c
  67. echo Option(s): [{Blank}=FGREP default="fl"]   [abBcvw, no minus]
  68. INPUT.COM option(s)=/b
  69. set option=%ans%
  70. :2c
  71. if "%file%" == "" set file=@%filelist%
  72.  
  73. :4a
  74. cls
  75. echo Search Text   = %S~~%
  76. echo File Name(s)  = %file%
  77. echo Option(s)     = %option%
  78. break on
  79. FGREP.COM -fl%option% /%S~~%/ %file% >c:\$.ql
  80. break off
  81. set >c:\$
  82. copy c:\$.ql c:\!
  83. Q.EXE        c:\!    /E%srmac%SRL.MAC /L%srmac%SRL.MAC
  84. goto 7a
  85. :6a
  86. echo.
  87. echo Search ──INCOMPLETE──
  88. goto 8a
  89. :7a
  90. echo.
  91. echo Search ──Complete──
  92. :8a
  93. echo.
  94.